﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SilverNotes
{
  public partial class Booklet : UserControl
  {
    #region // Pages
    public WriteableBitmap Page1
    {
      get { return (WriteableBitmap)GetValue(Page1Property); }
      set { SetValue(Page1Property, value); }
    }

    public static readonly DependencyProperty Page1Property =
        DependencyProperty.Register("Page1", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));

    public WriteableBitmap Page2
    {
      get { return (WriteableBitmap)GetValue(Page2Property); }
      set { SetValue(Page2Property, value); }
    }

    public static readonly DependencyProperty Page2Property =
        DependencyProperty.Register("Page2", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));

    public WriteableBitmap Page3
    {
      get { return (WriteableBitmap)GetValue(Page3Property); }
      set { SetValue(Page3Property, value); }
    }

    public static readonly DependencyProperty Page3Property =
        DependencyProperty.Register("Page3", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));

    public WriteableBitmap Page4
    {
      get { return (WriteableBitmap)GetValue(Page4Property); }
      set { SetValue(Page4Property, value); }
    }

    public static readonly DependencyProperty Page4Property =
        DependencyProperty.Register("Page4", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));

    public WriteableBitmap Page5
    {
      get { return (WriteableBitmap)GetValue(Page5Property); }
      set { SetValue(Page5Property, value); }
    }

    public static readonly DependencyProperty Page5Property =
        DependencyProperty.Register("Page5", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));
    
    public WriteableBitmap Page6
    {
      get { return (WriteableBitmap)GetValue(Page6Property); }
      set { SetValue(Page6Property, value); }
    }

    public static readonly DependencyProperty Page6Property =
        DependencyProperty.Register("Page6", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));

    public WriteableBitmap Page7
    {
      get { return (WriteableBitmap)GetValue(Page7Property); }
      set { SetValue(Page7Property, value); }
    }

    public static readonly DependencyProperty Page7Property =
        DependencyProperty.Register("Page7", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));

    public WriteableBitmap Page8
    {
      get { return (WriteableBitmap)GetValue(Page8Property); }
      set { SetValue(Page8Property, value); }
    }

    public static readonly DependencyProperty Page8Property =
        DependencyProperty.Register("Page8", typeof(WriteableBitmap), typeof(Booklet), new PropertyMetadata(null));

    #endregion

    

    public Booklet()
    {
      InitializeComponent();
      DataContext = this;
    }

    public void SetPages(WriteableBitmap[] pages)
    {
      Page1 = pages[0];
      Page2 = pages[1];
      Page3 = pages[2];
      Page4 = pages[3];
      Page5 = pages[4];
      Page6 = pages[5];
      Page7 = pages[6];
      Page8 = pages[7];
    }
  }
}
